package com.gzy.rpsm_property.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


    @Configuration
    public class APIWebConfig implements WebMvcConfigurer {
        @Override
        public void addInterceptors(InterceptorRegistry registry) {
            registry.addInterceptor(new LoginInterceptor())
                    .addPathPatterns("/**") // 需要拦截的路径,/**拦截所有路径，包括静态资源
                    .excludePathPatterns(
                            "/","/admin/login","/doc.html",
                            "/error","/swagger**/**","/webjars/**",
                            "/v3/**", "/user/login"); //不需要拦截的路径
        }
    }

